//
//  XqobjViewController.m
//  结伴
//
//  Created by wsl on 16/8/31.
//  Copyright © 2016年 aleven. All rights reserved.
//

#import "XqobjViewController.h"
#import "DLTabedSlideView.h"
#import "LikeViewController.h"

@interface XqobjViewController ()<DLTabedSlideViewDelegate>
@property (weak, nonatomic) IBOutlet DLTabedSlideView *View_main;

@property(nonatomic,strong) NSMutableArray *arry;

@end

@implementation XqobjViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    self.title = @"对象";
    
    [self addController];
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    //导航栏ios7偏移问题解决
    self.navigationController.navigationBar.translucent = NO;
}


-(void)addController{
    
    
    self.arry = [NSMutableArray array];
    [self.arry addObject:[[LikeViewController alloc]init]];
    [self.arry addObject:[[LikeViewController alloc]init]];
    [self.arry addObject:[[LikeViewController alloc]init]];
    [self.arry addObject:[[LikeViewController alloc]init]];
    [self.arry addObject:[[LikeViewController alloc]init]];
    
    self.View_main.delegate = self;
    self.View_main.baseViewController = self;
    /** 点击之前的文字颜色*/
    self.View_main.tabItemNormalColor = [UIColor grayColor];
    /** 点击之后的文字颜色*/
    self.View_main.tabItemSelectedColor = [UIColor greenColor];
    /** 底部滑条颜色*/
    self.View_main.tabbarTrackColor = [UIColor greenColor];
    
    /** 设置背景色*/
    self.View_main.backgroundColor = [UIColor whiteColor];
    /** 添加背景图片*/
    self.View_main.tabbarBackgroundImage = [UIImage imageNamed:@"QQ20160810-0"];
    //高度
    self.View_main.tabbarHeight = 45;
    
    self.View_main.tabbarBottomSpacing = 1.0;
    
    DLTabedbarItem *item1 = [DLTabedbarItem itemWithTitle:@"学生" image: nil selectedImage:nil];
    DLTabedbarItem *item2 = [DLTabedbarItem itemWithTitle:@"工作" image: nil selectedImage:nil];
    
    DLTabedbarItem *item3 = [DLTabedbarItem itemWithTitle:@"旅游达人" image: nil selectedImage:nil];
    DLTabedbarItem *item4 = [DLTabedbarItem itemWithTitle:@"90后" image: nil selectedImage:nil];
    DLTabedbarItem *item5 = [DLTabedbarItem itemWithTitle:@"80后" image: nil selectedImage:nil];
    
    
    self.View_main.tabbarItems = @[item1,item2,item3,item4,item5];
    [self.View_main buildTabbar];
    self.View_main.selectedIndex = 0;
    

    
}

- (NSInteger)numberOfTabsInDLTabedSlideView:(DLTabedSlideView *)sender{
    return self.arry.count;
}
- (UIViewController *)DLTabedSlideView:(DLTabedSlideView *)sender controllerAt:(NSInteger)index{
    UIViewController *vc = self.arry[index];
    return vc;
}

- (void)DLTabedSlideView:(DLTabedSlideView *)sender didSelectedAt:(NSInteger)index{
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
